﻿namespace ChessToys
{
    /// <summary>
    /// Specifies the color of a <see cref="IPiece"/>.
    /// </summary>
    public enum Color
    {
        /// <summary>
        /// Black.
        /// </summary>
        Black,

        /// <summary>
        /// White.
        /// </summary>
        White,
    }

    /// <summary>
    /// Static class holding extension methods for <see cref="Color"/>.
    /// </summary>
    public static class ColorExtensions
    {
        /// <summary>
        /// Toggles the specified color.
        /// </summary>
        /// <param name="color">The color.</param>
        /// <returns>The toggled color.</returns>
        public static Color Toggle(this Color color)
        {
            if (color == Color.White)
            {
                return Color.Black;
            }
            return Color.White;
        }
    }
}
